const binaryArrayToNumber = arr => {
    return arr.reverse().reduce((x,y,index)=>x+y*Math.pow(2,index),0)
};
const binaryArrayToNumber1 = arr =>{
    return parseInt(arr.join(''),2)
}
console.log(binaryArrayToNumber([0,1,1,0]))